<?php
	if (strtolower($_SERVER['REQUEST_METHOD']) === 'post')
	{
		//supplier
		if (isset($_POST['supplierAction']) and ($_POST['supplierAction'] === 'create'))
		{
			createSupplier();
		}
		if (isset($_POST['supplierAction']) and ($_POST['supplierAction'] === 'edit'))
		{
			updateSupplier();
		}
		if (isset($_POST['supplierAction']) and ($_POST['supplierAction'] === 'delete'))
		{
			deleteSupplier();
		}
		//inventory
		if (isset($_POST['inventoryAction']) and ($_POST['inventoryAction'] === 'create'))
		{
			createInventoryItem();
		}
		if (isset($_POST['inventoryAction']) and ($_POST['inventoryAction'] === 'edit'))
		{
			updateInventoryItem('');
		}
		if (isset($_POST['inventoryAction']) and ($_POST['inventoryAction'] === 'plus'))
		{
			updateInventoryItem('plus');
		}
		if (isset($_POST['inventoryAction']) and ($_POST['inventoryAction'] === 'minus'))
		{
			updateInventoryItem('minus');
		}
		if (isset($_POST['inventoryAction']) and ($_POST['inventoryAction'] === 'delete'))
		{
			deleteInventoryItem();
		}
		//profile
		if (isset($_POST['profileAction']) and ($_POST['profileAction'] === 'create'))
		{
			createProfile();
		}
		if (isset($_POST['profileAction']) and ($_POST['profileAction'] === 'edit'))
		{
			updateProfile();
		}
		if (isset($_POST['profileAction']) and ($_POST['profileAction'] === 'delete'))
		{
			deleteProfile();
		}
		if (isset($_POST['profileAction']) and ($_POST['profileAction'] === 'search'))
		{
			searchProfile();
		}
		if (isset($_POST['profileAction']) and ($_POST['profileAction'] === 'setSelectedCarIndex'))
		{
			selectedCar();
		}
		if (isset($_POST['carAction']) and ($_POST['carAction'] === 'create'))
		{
			createCar();
		}
		if (isset($_POST['carAction']) and ($_POST['carAction'] === 'edit'))
		{
			updateCar();
		}
		if (isset($_POST['carAction']) and ($_POST['carAction'] === 'delete'))
		{
			deleteCar();
		}
		if (isset($_POST['carAction']) and ($_POST['carAction'] === 'cancel'))
		{
			searchProfile();
		}
		//appointment
		if (isset($_POST['appointmentAction']) and ($_POST['appointmentAction'] === 'create'))
		{
			createAppointment();
		}
		if (isset($_POST['appointmentAction']) and ($_POST['appointmentAction'] === 'edit'))
		{
			updateAppointment();
		}
		if (isset($_POST['appointmentAction']) and ($_POST['appointmentAction'] === 'delete'))
		{
			deleteAppointment();
		}
		if (isset($_POST['appointmentAction']) and ($_POST['appointmentAction'] === 'search'))
		{
			searchAppointment();
		}
		if (isset($_POST['appointmentAction']) and ($_POST['appointmentAction'] === 'setSelectedCarIndex'))
		{
			selectedAppointmentCar();
		}
		if (isset($_POST['appointmentAction']) and ($_POST['appointmentAction'] === 'setSelectedAppointment'))
		{
			selectedAppointment();
		}
		if (isset($_POST['appointmentAction']) and ($_POST['appointmentAction'] === 'showNextWeek'))
		{
			nextWeekAppointments();
		}
		if (isset($_POST['appointmentAction']) and ($_POST['appointmentAction'] === 'showLastWeek'))
		{
			lastWeekAppointments();
		}
		if (isset($_POST['appointmentAction']) and ($_POST['appointmentAction'] === 'end'))
		{
			endAppointment();
		}
		//notification
		if (isset($_POST['notificationAction']) and ($_POST['notificationAction'] === 'send'))
		{
			sendNotification();
		}
		if (isset($_POST['notificationAction']) and ($_POST['notificationAction'] === 'edit'))
		{
			updateNotification();
		}
		//report
		if (isset($_POST['reportAction']) and ($_POST['reportAction'] === 'procedurePerformed'))
		{
			procedurePerformedReport();
		}
		if (isset($_POST['reportAction']) and ($_POST['reportAction'] === 'inventoryNeeded'))
		{
			inventoryNeededReport();
		}
		if (isset($_POST['reportAction']) and ($_POST['reportAction'] === 'inventoryUsed'))
		{
			inventoryUsedReport();
		}
		if (isset($_POST['reportAction']) and ($_POST['reportAction'] === 'appointmentHours'))
		{
			appointmentHoursReport();
		}
		//procedure
		if (isset($_POST['procedureAction']) and ($_POST['procedureAction'] === 'select'))
		{
			selectedProcProcedure();
		}
		if (isset($_POST['procedureAction']) and ($_POST['procedureAction'] === 'edit'))
		{
			updateProcProcedure();
		}
		if (isset($_POST['procedureAction']) and ($_POST['procedureAction'] === 'delete'))
		{
			deleteProcProcedure();
		}
		if (isset($_POST['procedureAction']) and ($_POST['procedureAction'] === 'create'))
		{
			createProcProcedure();
		}
	}
	
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" id="bgcolor">
<head>
	<title><?php echo html($title); ?></title>
	<link rel="stylesheet" type="text/css" href="http://localhost/TEAMEKA/application/Offline/Styles/myCss.css">
	<link rel="shortcut icon" href="http://localhost/TEAMEKA/application/Offline/Images/icon.png" >
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	
<!--- This clock function is referred to W3School.com, it is used to simply show time on the app-->
<script>  
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
m=checkTime(m);
s=checkTime(s);
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
t=setTimeout(function(){startTime()},500);
}

function checkTime(i)
{
if (i<10)
  {
  i="0" + i;
  }
return i;
}
</script>

	
	
</head>
<body onload="startTime()">
	<table id="page" style="border:0px solid red;">
		<tr>
			<td colspan="3">
			<div class="round">
				<table id="headerTable">
						<td style="border:0px solid black; width:30%; text-align:left; padding-left:200px;">
						      <b>Address:</b><br> 1600 Soucy,Saint-Hubert QC,J4T 1A3<br>
							  <b>Phone:</b> <br>450-656-7199
						</td>
				
						<td style="border:0px solid black; width:40%; text-align:center">
							<!--<h1 id="logo">Garage E.K.A.</h1>-->
							<img src="http://localhost/TEAMEKA/application/Offline/Images/logo.png" alt="Garage E.K.A. logo" height="135" width="400"> 
						</td>
				
						<td style="border:0px solid black; width:30%; text-align:right; padding-right:200px; ">
							<?php
								echo date("d-M-Y");
								echo "<br>";
								echo date("l");
							?> 
							
							<div id="txt"></div>
							<button class="btn" type="button" name="Help" value="Help" onclick="window.location.href='<?php echo $_SERVER['HTTP_ROOT']; ?>help/';">
								Help ?
							</button>
						</td>
						
						<td colspan="3"><hr></td>
				</table>
			</div>
			</td>
		</tr>
		<tr>
			<td colspan="3">
				
			</td>
		</tr>
		<tr>
			<td colspan="3">
				<!-- Supplier error handling -->
				<?php if (isset($_COOKIE["SupplierPhone"]) and ($_COOKIE["SupplierPhone"] === "InvalidPhone")) : ?>
  					<b style="color:#8B0000"> Invalid supplier's phone number! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["SupplierName"]) and ($_COOKIE["SupplierName"] === "EmptyName")) : ?>
  					<b style="color:#8B0000"> Supplier's name cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["DeleteSupplier"]) and ($_COOKIE["DeleteSupplier"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to delete supplier contact! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CreateSupplier"]) and ($_COOKIE["CreateSupplier"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to create supplier contact! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["UpdateSupplier"]) and ($_COOKIE["UpdateSupplier"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to update supplier contact! Please try again </b><br/>
  				<?php endif; ?>
  				<!-- Inventory error handling -->
				<?php if (isset($_COOKIE["ProductName"]) and ($_COOKIE["ProductName"] === "EmptyName")) : ?>
  					<b style="color:#8B0000"> Item field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProductDescription"]) and ($_COOKIE["ProductDescription"] === "EmptyDescription")) : ?>
  					<b style="color:#8B0000"> Description field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProductQuantity"]) and ($_COOKIE["ProductQuantity"] === "EmptyQuantity")) : ?>
  					<b style="color:#8B0000"> Quantity field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProductQuantity"]) and ($_COOKIE["ProductQuantity"] === "InvalidQuantity")) : ?>
  					<b style="color:#8B0000"> Invalid quantity entered! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProductQuantity"]) and ($_COOKIE["ProductQuantity"] === "NegativeQuantity")) : ?>
  					<b style="color:#8B0000"> Item quantity cannot be negative! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["DeleteInventory"]) and ($_COOKIE["DeleteInventory"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to delete inventory! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CreateInventory"]) and ($_COOKIE["CreateInventory"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to create inventory! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["UpdateInventory"]) and ($_COOKIE["UpdateInventory"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to update inventory! Please try again </b><br/>
  				<?php endif; ?>
  				<!-- Profile error handling -->
  				<?php if (isset($_COOKIE["ProfilePhone"]) and ($_COOKIE["ProfilePhone"] === "InvalidPhone")) : ?>
  					<b style="color:#8B0000"> Invalid phone number entered! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["SearchProfile"]) and ($_COOKIE["SearchProfile"] === "PersonNotExist")) : ?>
  					<b style="color:#8B0000"> Profile not found! Please try another number </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["SearchProfile"]) and ($_COOKIE["SearchProfile"] === "ProfileNotExist")) : ?>
  					<b style="color:#8B0000"> Profile ID not found! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProfileGender"]) and ($_COOKIE["ProfileGender"] === "EmptyGender")) : ?>
  					<b style="color:#8B0000"> Please select a gender and try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProfileFName"]) and ($_COOKIE["ProfileFName"] === "EmptyFName")) : ?>
  					<b style="color:#8B0000"> First name field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProfileLName"]) and ($_COOKIE["ProfileLName"] === "EmptyLName")) : ?>
  					<b style="color:#8B0000"> Last name field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProfileHomePhone"]) and ($_COOKIE["ProfileHomePhone"] === "InvalidPhone")) : ?>
  					<b style="color:#8B0000"> Invalid home phone number! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProfileHomePhone"]) and ($_COOKIE["ProfileHomePhone"] === "ExistingPhone")) : ?>
  					<b style="color:#8B0000"> Home phone number entered already exists! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProfileCellPhone"]) and ($_COOKIE["ProfileCellPhone"] === "InvalidPhone")) : ?>
  					<b style="color:#8B0000"> Invalid cell phone number! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["DeleteProfile"]) and ($_COOKIE["DeleteProfile"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to delete profile! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CreateProfile"]) and ($_COOKIE["CreateProfile"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to create profile! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["UpdateProfile"]) and ($_COOKIE["UpdateProfile"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to update profile! Please try again </b><br/>
  				<?php endif; ?>
  				<!-- Car error handling -->
				<?php if (isset($_COOKIE["CarIndex"]) and ($_COOKIE["CarIndex"] === "EmptyIndex")) : ?>
  					<b style="color:#8B0000"> Selected car index cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CarHistory"]) and ($_COOKIE["CarHistory"] === "EmptyHistory")) : ?>
  					<b style="color:#8B0000"> Car history field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CarMake"]) and ($_COOKIE["CarMake"] === "EmptyMake")) : ?>
  					<b style="color:#8B0000"> Car make field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CarModel"]) and ($_COOKIE["CarModel"] === "EmptyModel")) : ?>
  					<b style="color:#8B0000"> Car model field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CarYear"]) and ($_COOKIE["CarYear"] === "EmptyYear")) : ?>
  					<b style="color:#8B0000"> Car year field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CarYear"]) and ($_COOKIE["CarYear"] === "InvalidYear")) : ?>
  					<b style="color:#8B0000"> Invalid car year entered! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["LastOilChangeDate"]) and ($_COOKIE["LastOilChangeDate"] === "InvalidLastOilChangeDate")) : ?>
  					<b style="color:#8B0000"> Invalid last oil change date entered! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["DeleteCar"]) and ($_COOKIE["DeleteCar"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to delete car! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CreateCar"]) and ($_COOKIE["CreateCar"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to create car! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["UpdateCar"]) and ($_COOKIE["UpdateCar"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to update car! Please try again </b><br/>
  				<?php endif; ?>
  				<!-- Appointment error handling -->
  				<?php if (isset($_COOKIE["AppointmentPhone"]) and ($_COOKIE["AppointmentPhone"] === "InvalidPhone")) : ?>
  					<b style="color:#8B0000"> Invalid phone number entered! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["SearchAppointment"]) and ($_COOKIE["SearchAppointment"] === "PersonNotExist")) : ?>
  					<b style="color:#8B0000"> There is no profile associated to the phone number entered! Please try another number </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["SearchAppointment"]) and ($_COOKIE["SearchAppointment"] === "ProfileNotExist")) : ?>
  					<b style="color:#8B0000"> Profile ID not found! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["Date"]) and ($_COOKIE["Date"] === "EmptyDate")) : ?>
  					<b style="color:#8B0000"> Appointment date field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["Date"]) and ($_COOKIE["Date"] === "InvalidDate")) : ?>
  					<b style="color:#8B0000"> Invalid appointment date entered! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["StartTime"]) and ($_COOKIE["StartTime"] === "EmptyStartTime")) : ?>
  					<b style="color:#8B0000"> Please select a start time and try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["EndTime"]) and ($_COOKIE["EndTime"] === "EmptyEndTime")) : ?>
  					<b style="color:#8B0000"> Please select an end time and try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["TimeSlot"]) and ($_COOKIE["TimeSlot"] === "InvalidTimeSlot")) : ?>
  					<b style="color:#8B0000"> Invalid timeslot! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["TotalEstimateTime"]) and ($_COOKIE["TotalEstimateTime"] === "EmptyTotalEstimateTime")) : ?>
  					<b style="color:#8B0000"> Invalid total estimate time! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["Status"]) and ($_COOKIE["Status"] === "EmptyStatus")) : ?>
  					<b style="color:#8B0000"> Invalid appointment status! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CarId"]) and ($_COOKIE["CarId"] === "EmptyCarId")) : ?>
  					<b style="color:#8B0000"> Please select a car and try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["Procedure"]) and ($_COOKIE["Procedure"] === "EmptyProcedure")) : ?>
  					<b style="color:#8B0000"> Please select at least a procedure and try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["Conflict"]) and ($_COOKIE["Conflict"] === "AppointmentConflict")) : ?>
  					<b style="color:#8B0000"> There is a conflict with another appointment! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["DeleteAppointment"]) and ($_COOKIE["DeleteAppointment"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to delete appointment! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CreateAppointment"]) and ($_COOKIE["CreateAppointment"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to create appointment! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["UpdateAppointment"]) and ($_COOKIE["UpdateAppointment"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to update appointment! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["EndAppointment"]) and ($_COOKIE["EndAppointment"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to end appointment! Please try again </b><br/>
  				<?php endif; ?>
  				<!-- Notification error handling -->
				<?php if (isset($_COOKIE["NotificationMsg"]) and ($_COOKIE["NotificationMsg"] === "EmptyNotificationMsg")) : ?>
  					<b style="color:#8B0000"> Automatic notification template field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["NotificationSubject"]) and ($_COOKIE["NotificationSubject"] === "EmptyNotificationSubject")) : ?>
  					<b style="color:#8B0000"> Notification subject cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["NotificationBody"]) and ($_COOKIE["NotificationBody"] === "EmptyNotificationBody")) : ?>
  					<b style="color:#8B0000"> Notification body cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["SendNotification"]) and ($_COOKIE["SendNotification"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to send notification! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["UpdateNotification"]) and ($_COOKIE["UpdateNotification"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to update notification template! Please try again </b><br/>
  				<?php endif; ?>
  				<!-- Report error handling -->
				<?php if (isset($_COOKIE["StartDate"]) and ($_COOKIE["StartDate"] === "EmptyStartDate")) : ?>
  					<b style="color:#8B0000"> Report start date field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["StartDate"]) and ($_COOKIE["StartDate"] === "InvalidStartDate")) : ?>
  					<b style="color:#8B0000"> Invalid report start date entered! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["EndDate"]) and ($_COOKIE["EndDate"] === "EmptyEndDate")) : ?>
  					<b style="color:#8B0000"> Report end date field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["EndDate"]) and ($_COOKIE["EndDate"] === "InvalidEndDate")) : ?>
  					<b style="color:#8B0000"> Invalid report end date entered! Please try again </b><br/>
  				<?php endif; ?>
  				<!-- Procedure error handling -->
				<?php if (isset($_COOKIE["ProcProcedure"]) and ($_COOKIE["ProcProcedure"] === "EmptyProcProcedure")) : ?>
  					<b style="color:#8B0000"> Please select at least one procedure and try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProcProcedureName"]) and ($_COOKIE["ProcProcedureName"] === "EmptyProcProcedureName")) : ?>
  					<b style="color:#8B0000"> Procedure name field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProcProcedureDuration"]) and ($_COOKIE["ProcProcedureDuration"] === "EmptyProcProcedureDuration")) : ?>
  					<b style="color:#8B0000"> Procedure duration field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProcProcedureDuration"]) and ($_COOKIE["ProcProcedureDuration"] === "InvalidProcProcedureDuration")) : ?>
  					<b style="color:#8B0000"> Invalid procedure duration entered! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProcProcedureDuration"]) and ($_COOKIE["ProcProcedureDuration"] === "NegativeProcProcedureDuration")) : ?>
  					<b style="color:#8B0000"> Procedure duration cannot be negative! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProcItemsList"]) and ($_COOKIE["ProcItemsList"] === "EmptyProcItemsList")) : ?>
  					<b style="color:#8B0000"> Please add at least one item and try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProcQuantityList"]) and ($_COOKIE["ProcQuantityList"] === "EmptyProcQuantityList")) : ?>
  					<b style="color:#8B0000"> Item quantity field cannot be empty! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProcQuantityList"]) and ($_COOKIE["ProcQuantityList"] === "NegativeProcQuantityList")) : ?>
  					<b style="color:#8B0000"> Item quantity cannot be negative! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["ProcQuantityList"]) and ($_COOKIE["ProcQuantityList"] === "InvalidProcQuantityList")) : ?>
  					<b style="color:#8B0000"> Invalid item quantity entered! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["UpdateProcProcedure"]) and ($_COOKIE["UpdateProcProcedure"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to update procedure! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["DeleteProcProcedure"]) and ($_COOKIE["DeleteProcProcedure"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to delete procedure! Please try again </b><br/>
  				<?php endif; ?>
  				<?php if (isset($_COOKIE["CreateProcProcedure"]) and ($_COOKIE["CreateProcProcedure"] === "Unsuccessful")) : ?>
  					<b style="color:#8B0000"> Failed to create procedure! Please try again </b><br/>
  				<?php endif; ?>
			</td>
		</tr>
		
		
		